'use strict';

const Service = require('egg').Service;

class UserService extends Service {
  async selectUser(username) {
    return await this.app.mysql.query('select * from userlist where username=?',[username])
  }

  //注册
  async registry(username,password){
    return await this.app.mysql.query('insert into userlist (username,password) values (?,?)',[username,password])
  }

  //login
  async login(username,password){
      return await this.app.mysql.query('select * from userlist where username=? and password=?',[username,password])
  }
}

module.exports = UserService;
